package com.rtwo.utils;

import com.rtwo.redisdao.RedisUtil;
import org.springframework.cache.CacheManager;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import javax.annotation.Resource;

/**
 * Created by hasee on 2017/4/27.
 */
@Configuration
@EnableScheduling
public class Counter {

    @Resource
    private RedisUtil redisUtil;

    @Resource
    private CacheManager cacheManager;

//    @Scheduled(cron = "*/2 * * * * ?")//每2s执行一次?
    public void scheduler(){
        System.out.println(redisUtil.get("syn"));
    }
}
